package cc.comac.saic.hkhy.jsrj.gj.inttools.service;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.IService;
import cc.comac.saic.hkhy.jsrj.gj.inttools.pojo.entity.SysAsyncTask;

/**
 * 异步任务表(SysAsyncTask)表服务接口
 *
 * @author makejava
 * @since 2025-11-20 10:29:15
 */
@Service
public interface SysAsyncTaskService extends IService<SysAsyncTask> {

    int createTask(SysAsyncTask task);

    SysAsyncTask getTaskById(Long taskId);

    List<SysAsyncTask> selectTaskList(SysAsyncTask task);

    int updateTask(SysAsyncTask task);

    int updateTaskProgress(Long taskId, Integer progress);

    int updateTaskStatus(Long taskId, String status, String errorMessage);

    int updateTaskResult(Long taskId, String resultData, String status);

    int deleteTaskByIds(Long[] taskIds);

    void cleanExpiredTasks(int days);

    Map<String, Object> getTaskStats();
}

